package com.huluobo.user

import com.huluobo.lib_base.Res
import com.huluobo.user.entity.ApproveBean
import kotlinx.coroutines.flow.Flow
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

/**
 *  Created by LC on 2025/2/12.
 */
interface ApiService {
    @POST("/api/staff/save")
    fun addEmployee(@Body body: RequestBody): Flow<Res<Any>>

    @POST("/api/user/login")
    fun login(@Body body: RequestBody): Flow<Res<String>>

    @POST("/api/leave/save")
    fun addApprove(@Body body: RequestBody): Flow<Res<Any>>

    @GET("/api/leave/all?status=1")
    fun getApproves(): Flow<Res<ApproveBean>>

    @POST("/api/leave/audit")
    fun approve(@Body body: RequestBody): Flow<Res<Any>>

    @GET("/api/leave/page")
    suspend fun getApprovesPage(@Query("page") page: String, @Query("limit") limit: String): Res<ApproveBean>
}